package com.hatricks.is.base.stream;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @packageName: com.xh.stream
 * @className: StreamTest
 * @author: yanyuhui yanyuhui@chinasofti.com
 * @date: 2022/1/22 11:06
 * @description: 流式调用测试
 */
public class StreamTest {

    public static void main(String[] args) {
        List<String> container = new ArrayList<>();
        container.add("1");
        container.add("2");
        container.add("3");
        container.add("4");

        Map<String, String> map = container.stream().collect(Collectors.toMap(String::toString, x -> x));
        System.out.println(map);

        String name = "12";
        final String ns = name;
        System.out.println(ns);
        System.out.println(name);
        name = "456";
        System.out.println(ns);
        System.out.println(name);
    }


    public static void printlnAge() {
        System.out.println("我今年27岁了");
    }


}
